﻿using System;
using System.Collections.Generic;
using static CommonModel.Model.DataTypeDll;

namespace CommonModel.Model
{
    public class SchemaDictionary
    {
		public string name; // 字段名称
		public DataType type; // 字段类型
		public string value; // 字段值

		private int index;
		private int size; // 类型所占字节数, 即该数据类型占几个字节
		private string deviceType;
		private bool IsAlarm;
		private string alarmValue;
		private string alarmName;
		// 因为存在部分结构体是在实际的数据字段中指出有多少个, 所以结构体个数给字符串, 给数字无法在解析规则文件时生成对象
		private string loop;
		// 2020/04/30 增加命令码的 code 属性
		private string code;

		private string memo;
		private string isSave;
		private string id;
		private int layer;

		private Dictionary<int, Object> fieldDictionary;

		public string getName()
		{
			return name;
		}

		public void setName(string name)
		{
			this.name = name;
		}

		public int getLayer()
		{
			return this.layer;
		}

		public void setLayer(int layer)
		{
			this.layer = layer;
		}

		public string getId()
		{
			return this.id;
		}

		public void setId(string id)
		{
			this.id = id;
		}

		public string getMemo()
		{
			return this.memo;
		}

		public void setMemo(string memo)
		{
			this.memo = memo;
		}

		public DataType getType()
		{
			return type;
		}

		public void setType(DataType type)
		{
			this.type = type;
		}

		public string getValue()
		{
			return value;
		}

		public void setValue(string value)
		{
			this.value = value;
		}

		public int getIndex()
		{
			return index;
		}

		public void setIndex(int index)
		{
			this.index = index;
		}

		public int getSize()
		{
			return size;
		}

		public void setIsSave(string isSave)
		{
			this.isSave = isSave;
		}

		public string getIsSave()
		{
			return this.isSave;
		}

		public void setSize(int size)
		{
			this.size = size;
		}

		public string getDeviceType()
		{
			return deviceType;
		}

		public void setDeviceType(string deviceType)
		{
			this.deviceType = deviceType;
		}

		public bool isAlarm()
		{
			return IsAlarm;
		}

		public void setAlarm(bool IsAlarm)
		{
			this.IsAlarm = IsAlarm;
		}

		public string getAlarmValue()
		{
			return alarmValue;
		}

		public void setAlarmValue(string alarmValue)
		{
			this.alarmValue = alarmValue;
		}

		public string getAlarmName()
		{
			return alarmName;
		}

		public void setAlarmName(string alarmName)
		{
			this.alarmName = alarmName;
		}

		public string getLoop()
		{
			return loop;
		}

		public void setLoop(string loop)
		{
			this.loop = loop;
		}

		public Dictionary<int, Object> getFieldDictionary()
		{
			return fieldDictionary;
		}

		public void setFieldDictionary(Dictionary<int, Object> fieldDictionary)
		{
			this.fieldDictionary = fieldDictionary;
		}

		public string getCode()
		{
			return code;
		}

		public void setCode(string code)
		{
			this.code = code;
		}
	}
}
